    //
//  personalOfficeController.m
//  tianjianOA
//
//  Created by tianhe xie on 12-3-18.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import "personalOfficeController.h"


@implementation personalOfficeController

// The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
/*
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization.
    }
    return self;
}
*/
-(id)init
{
	if (self = [super init])
	{
	
		self.title = @"个人办公";
		
		dataArray = [[NSMutableArray alloc] initWithObjects:@"工作任务",@"文件共享",@"短信中心",nil];
		
		
	}

	return self;
}

// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
	[super loadView];
	self.navigationController.tabBarItem.badgeValue = @"1";
	
	self.view.backgroundColor = [UIColor clearColor];
	
	
	table = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)
											   style:UITableViewStyleGrouped];
	
	
	
	table.delegate = self;
	table.dataSource = self;
	
	[self.view addSubview:table];
	
}


/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
	self.view.backgroundColor = [UIColor clearColor];
	
	
    [super viewDidLoad];
}
*/

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

#pragma mark -
#pragma mark Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
	return [dataArray count];
}

#pragma mark - table delegate

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{

	NSInteger row = indexPath.row;
	UITableViewCell *cell;
	
	cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
	if (cell == NULL) {
		cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
		cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
	
	}
	cell.textLabel.text = [dataArray objectAtIndex:row];
	
	
	return cell;

}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
	NSInteger row = indexPath.row;
	switch (row) {
		case 0:
			{
		
			}
			break;
		case 1:
			{
		
			}
			break;
		case 2:
			{
		
			}
			break;

		default:
			break;
	}
}

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
	safe_release(table);
	safe_release(dataArray);
	
    [super dealloc];
}


@end
